file chooser: Avoid nonworking search+save combinations
authorMatthias Clasen <mclasen@redhat.com>
Sat, 13 Feb 2016 03:05:40 +0000 (22:05 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 13 Feb 2016 03:05:40 +0000 (22:05 -0500)
With the location entry up in the header bar in save mode, we can
end up with the search model being in use when the user types in
the location entry. In this case, we don't make the Save button
sensitive as we should.

Having two entries in the dialog is somewhat confusing anyway,
so just stop the search when the user starts typing in the location
entry.

https://bugzilla.gnome.org/show_bug.cgi?id=761757

gtk/gtkfilechooserwidget.c

index 6ef25b6cf50ec41e5955dc9304204f3661d5acd0..1364def2a5add3a044c1d1bf63201a054a50a2f2 100644 (file)
@@ -2563,6 +2563,9 @@ static void
 location_entry_changed_cb (GtkEditable          *editable,
                            GtkFileChooserWidget *impl)
 {
+  if (impl->priv->operation_mode == OPERATION_MODE_SEARCH)
+    operation_mode_set (impl, OPERATION_MODE_BROWSE);
+
   if (impl->priv->action != GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
     reset_location_timeout (impl);
 }